<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../../css/public/base.css">
    <link rel="stylesheet" href="../../css/announcement/notice.css">
    <!--<link rel="stylesheet" href="../../css/announcement/table.css">-->
    <link rel="stylesheet" href="../../css/news/information.css">
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <script src="../../js/public/jquery-3.3.1.js"></script>

</head>

<body>
    
    <div class="notice-content">
        <!-- top部分 -->
        <!-- <form action="" class="notice-header">
            <div class="left">
                <span>发布时间 </span>
                <input type="text" placeholder="请输入...">
            </div>
            <div class="right">
                <input type="button" value="查询">
                <input type="reset" value="重置 ">
                展开<select name="" id=""></select>
            </div>
        </form> -->
        <!-- 发布资讯-->
        <div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
            <button data-method="notice" class="layui-btn" id="release">发布资讯</button>
        </div>

        <!-- 表格部分 -->
        <div class="rl-table">
            <table class="layui-hide" id="test" lay-filter="test"></table>
        </div>
    </div>

    <!-- 是否启用 -->
    <script type="text/html" id="switchTpl">
        <div class="layui-input-block">
                <input type="checkbox" name="switch" lay-skin="switch">
            </div>
    </script>

    <!-- 发布公告的弹层 -->
    <!--<form action="" class="noticeForm layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发布人ID</label>
            <div class="layui-input-block">
                <input type="text" name="title" readonly lay-verify="required" placeholder='张三' autocomplete="off"
                    class="layui-input read">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-block">
                <input type="text" name="title" required lay-verify="required" placeholder="2018.01.01 18:00:00"
                    autocomplete="off" class="layui-input" id="time_news">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">详情</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入你的阶段目标" required lay-verify="required" class="layui-textarea" style="resize:none;"></textarea>
            </div>
        </div>
    </form>-->

    <!-- 查看弹层的内容 -->
    <div class="lookcont">
            <div class="inline">
                <span>标题</span>
                <p>01</p>
            </div>
            <div class="inline">
                <span>发布人</span>
                <p>中国</p>
            </div>
            <div class="inline">
                <span>发布时间</span>
                <p>2018.11.11 18:00:00</p>
            </div>
            <div class="inline">
                <span>发布内容</span>
                <p>11111111111111</p>
            </div>
            <div class="inline">
                <span>浏览量</span>
                <p>123456</p>
            </div>
        </div>
    <script src="../../layui/layui.js"></script>
    <script type="text/html" id="barDemo">
        <a style="color:#2d528f;margin-right: 30px;" lay-event="detail" class="look">查看</a>
        <a style="color:#ff0000;" lay-event="del">删除</a>
      </script>
   
    <script>
        layui.use(['table', 'laypage', 'layer', 'form','laydate'], function () {
            var table = layui.table, //表格
                laypage = layui.laypage, //分页
                $ = layui.jquery, //弹框
                layer = layui.layer,
                form = layui.form //表单
                laydate = layui.laydate; //日期
                 // 表格数据
            table.render({
                elem: '#test'
                    //      , url: '/demo/table/user/'
                    ,
                skin: 'nob',
                width: '100%'
                    //        ,limits:[5,10,20,50]
                    ,
                cols: [
                    [{
                        type: 'checkbox'
                    }, {
                        field: 'id',
                        title: '序号',
                        minWidth: 100,
                        unresize: true
                    }, {
                        field: 'title',
                        title: '标题',
                        minWidth: 150,
                        unresize: true
                    }, {
                        field: 'abstract',
                        title: '摘要',
                        minWidth: 180,
                        unresize: true
                    }, {
                        field: 'releaseTime',
                        title: '发布时间',
                        minWidth: 180,
                        unresize: true,
                        sort: true
                    }, 
                    {
                        field: 'browseNum',
                        title: '浏览量',
                        minWidth: 170,
                        unresize: true
                    },{
                        field: 'ys',
                        title: '是否启用',
                        minWidth: 170,
                        unresize: true
                    }, {
                        field: 'sort',
                        title: '排序',
                        minWidth: 150,
                        unresize: true
                    }, {
                        field: 'operate',
                        title: '操作',
                        minWidth: 130,
                        toolbar: '#barDemo',
                        unresize: true,
                        fixed: 'right'
                    }]
                ],
                data: [{
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    },{
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    },{
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    },{
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    },{
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    },{
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }, {
                        "id": "01",
                        "title": 12345678,
                        "title": "中国中国",
                        "abstract": "12345611789",
                        "releaseTime": "2018.01.01 18:00:00",
                        "browseNum": "123",
                        "ys": "是否",
                        "sort": "01"
                    }],
                page: true
            });
            table.on('tool(test)', function (obj) {
                var data = obj.data;
                if (obj.event === 'detail') {
                    layer.open({
                        type: 1,
                        title: '信息',
                        closeBtn: 1,
                        area: '700px;',
                        shade: 0,
                        move: false,
                        id: 'LAY_layuipro', //设定一个id，防止重复弹出
                        btn: ['确定', '取消'],
                        btnAlign: 'c',
                        moveType: 1, //拖拽模式，0或者1
                        content: $('.lookcont'),
                        success: function () {
                            
                        }
                    });
                } else if (obj.event === 'del') {
                    layer.open({
                        type: 0,
                        id: 'turnDown' //防止重复弹出
                            ,
                        area: ['400px !important', '220px !important'],
                        title: "删除",
                        content: '<p style="font-size: 16px;height: 40px;line-height: 40px">是否确认 删除?</p>',
                        btn: ['确定', '取消'],
                        btnAlign: 'r' //按钮对齐方式
                            ,
                        shade: 0,
                        shadeClose: true,
                        move: false,
                        resize: false,
                        yes: function () {
                            layer.closeAll();
                            // layer.msg("成功删除")
                        },
                        btn2: function () {
                            layer.closeAll();
                        }
                    });
                }
            });
//时间控件
/*laydate.render({
                elem: '#time_news', //指定元素
                type: 'datetime',
                format: 'yyyy-MM-dd HH:mm:ss', //自定义格式化
                trigger: 'click', //采用click弹出
                theme:'#2d528f'
            });*/
            /*//触发事件
            var active = {
                notice: function () {
                    //发布公告 弹框层
                    layer.open({
                        type: 1,
                        title: '发布资讯',
                        closeBtn: 1,
                        move:false,
                        area: '710px;',
                        shade: 0,
                        id: 'LAY_layuipro', //设定一个id，防止重复弹出
                        btn: ['发布资讯'],
                        btnAlign: 'c',
                        moveType: 1, //拖拽模式，0或者1
                        content: $('.noticeForm'),
                        success: function () {
                           
                        }
                    });

                },
            };*/
            $('#layerDemo .layui-btn').on('click', function () {
              localStorage.setItem('adress','../news/postConsult.html');
            });
        });
    </script>
</body>

</html>